import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;

/**
 * @author 帅小伙
 * @date 2022/1/2
 * @description
 */
public class Task07 {

    private static final String NORMAL_EXCHANGE_NAME = "normal_exchange";

    public static void main(String[] args) throws Exception {
        Channel channel = RabbitMqUtils.getChannel();
        channel.exchangeDeclare(NORMAL_EXCHANGE_NAME, BuiltinExchangeType.DIRECT);


        for (int i = 0; i < 10; i++) {
            String message = "info"+i;
            // 给消息一个TTL时间     时间到期没有被消费之后进入死信队列
            channel.basicPublish(NORMAL_EXCHANGE_NAME,"zansan",null,message.getBytes());
        }



    }


}
